From a5e4155a752fa090c7bc3751a803b4359453e56c Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Sat, 25 Apr 2026 12:30:41 +0000
Subject: fix: frontend-backend connection bugs

Agent-Logs-Url: https://github.com/bertyuan/next-blog/sessions/f86da32b-3af7-4393-8077-ce3435137221

Co-authored-by: bertyuan <189593334+bertyuan@users.noreply.github.com>
---
 src/app/(main)/(home)/posts/[slug]/page.client.tsx | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

(limited to 'src/app/(main)/(home)/posts/[slug]/page.client.tsx')

diff --git a/src/app/(main)/(home)/posts/[slug]/page.client.tsx b/src/app/(main)/(home)/posts/[slug]/page.client.tsx
index 7a97f56..13dbfeb 100644
--- a/src/app/(main)/(home)/posts/[slug]/page.client.tsx
+++ b/src/app/(main)/(home)/posts/[slug]/page.client.tsx
@@ -7,7 +7,7 @@ import { Icons } from '@/components/icons/icons';
 import { Button } from '@/components/ui/button';
 import { cn } from '@/lib/utils';
 import { Comments } from '@fuma-comment/react';
-import { redirect } from 'next/navigation';
+import { useRouter } from 'next/navigation';
 import { useRef } from 'react';
 import { toast } from 'sonner';
 import { useCopyToClipboard } from 'usehooks-ts';
@@ -42,6 +42,7 @@ export function PostComments({
   slug,
   className,
 }: { slug: string; className?: string }) {
+  const router = useRouter();
   return (
     <Comments
       page={slug}
@@ -49,7 +50,7 @@ export function PostComments({
       auth={{
         type: 'api',
         signIn: () => {
-          redirect('/login');
+          router.push('/login');
         },
       }}
     />
-- 
cgit v1.2.3

